﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Interfleet.SE.UICompiler.Core;
using Interfleet.SE.UICompiler.Core.Batch;

namespace Interfleet.SE.UICompiler.UI.Models
{
    public class UICompilerModel
    {
        public UICompilerModel() { }

        public Arguments CreateArguments(CompileType compileType)
        {
            return CompileAgentFactory.CreateAgentFactory(compileType).CreateArguments();
        }

        public bool SaveAsBatch(string batchFilePath, Arguments arguments)
        {
            var persistor = new BatchPersistor(batchFilePath, arguments);
            return persistor.CreateBatchFile();
        }

        public Arguments OpenBatch(string batchFilePath)
        {
            var batchJob = new BatchJob(batchFilePath);
            return CompileAgentFactory.CreateArgumentsFromBatch(batchJob);
            
        }
    }
}
